<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html lang="en">
<head>
	<base href="<%=basePath%>">
  	<!-- jsp文件头和头部 -->
  	<%@ include file="../../system/admin/top.jsp"%> 
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>新建病例单</title>
    <link rel="stylesheet" href="static/css/common.css">
    <!--提示框-->
	<script type="text/javascript" src="static/js/jquery.tips.js"></script>
	<style>
    	.table th,
    	.table td {
    		text-align:center;
    		vertical-align:middle;
    	}
    	form {
		    margin: 0;
		    margin-top:10px;
		}
    </style>
</head>

<body>
    <div class="container-fluid" style="padding-left:0;padding-right:40px;">
    	<!-- 检索  -->
		<form action="caseOrder/findPatient.do" method="post" name="userForm" id="userForm">
			<table>
				<tr>
					<td>
						<span class="input-icon">
							<input autocomplete="off" id="nav-search-input" type="text" name="name" value="${pd.name}" placeholder="这里输入姓名" />
							<i id="nav-search-icon" class="icon-search"></i>
						</span>
					</td>
					<td>
						<span class="input-icon">
							<input autocomplete="off" id="phone" type="text" name="phone" value="${pd.phone}" placeholder="这里输入电话" />
							<i id="nav-search-icon2" class="icon-search"></i>
						</span>
					</td>
					<td style="vertical-align:top;"><button class="btn btn-mini btn-light" onclick="find();" title="检索"><i id="nav-search-icon" class="icon-search"></i></button></td>
				</tr>
			</table>
		</form>
		<!-- 检索  -->
			
		<!-- 查到多个患者时 -->
		<c:if test="${not empty allPatients}">
			<div id="more">
				<table id="table_report" class="table table-striped table-bordered table-hover">
					<thead>
						<tr>
							<th class="center">
							<label><input type="checkbox" id="zcheckbox" /><span class="lbl"></span></label>
							</th>
							<th>序号</th>
							<th>姓名</th>
							<th>患者来源</th>
							<th>性别</th>
							<th>年龄</th>
							<th>电话</th>
							<th>时间</th>
							<th class="center">操作</th>
						</tr>
					</thead>
					<tbody>
					<!-- 开始循环 -->	
						<c:forEach items="${allPatients}" var="patient" varStatus="vs">
							<tr>
								<td class='center' style="width: 30px;">
									<label><input type='checkbox' disabled="disabled" /><span class="lbl"></span></label>
								</td>
								<td class='center' style="width: 30px;">${vs.index+1}</td>
								<td>${patient.name }</td>
								<td>${patient.hzly }</td>
								<td>${patient.sex }</td>
								<td>${patient.age }</td>
								<td>${patient.phone }</td>
								<td>${patient.updatedate }</td>
								<td style="width:100px;">
									<a class='btn btn-mini btn-success' title="新建病历" href="<%=basePath%>caseOrder/findPatient?hzId=${patient.id}" >新建病历</a>
								</td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
				<div class="page-header position-relative">
					<table style="width:100%;">
						<tr>
							<td style="vertical-align:top;"><div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div></td>
						</tr>
					</table>
				</div>	
			</div>
		</c:if>
		
		<!-- 没有查到患者时 -->
		<c:if test="${has==0 }">
			<div>
				<table>
					<tr class="main_info">
						<td colspan="10" class="center">没有相关数据</td>
					</tr>
				</table>
			</div>
		</c:if>
    </div>
    
    <script type="text/javascript">
      	 $(function(){
	      	 $(top.hangge());
		 	var h = $(window).height();
	     	$('.main').css('height',h-40);
	     	$('input[type=radio]:checked').css('color','#007cde');
    	}); 
    </script>
</body>

</html>
